#pragma once

#define GLM_FORCE_RADIANS
#define GLM_FORCE_DEPTH_ZERO_TO_ONE
#include <glm/glm.hpp>


namespace njm {

    class NjmCamera
    {
    private:
        glm::mat4 projectionMat{1.f};
        glm::mat4 viewMat{1.f};
        glm::mat4 inverseViewMat{1.f};

    public:
        NjmCamera();
        ~NjmCamera();

        const glm::mat4& getProjection() const { return projectionMat; }
        const glm::mat4& getView() const { return viewMat; }
        const glm::mat4& getInverseView() const { return inverseViewMat; }
        const glm::vec3 getPosition() const { return glm::vec3(inverseViewMat[3]); }

        void setOrthographicProjection(float left, float right, float top, float bottom, float near, float far);
        void setPerspectiveProjection(float fovy, float aspect, float near, float far);

        void setViewDirection(glm::vec3 position, glm::vec3 direction, glm::vec3 up = glm::vec3{0.f, -1.f, 0.f});
        void setViewTarget(glm::vec3 position, glm::vec3 target, glm::vec3 up = glm::vec3{0.f, -1.f, 0.f});
        void setViewYXZ(glm::vec3 position, glm::vec3 rotation);
    };
}